package com.yunyao.web.controller;

import com.yunyao.common.dto.ReconciliationDto;
import com.yunyao.common.dto.SupplierDto;
import com.yunyao.common.web.util.PageResult;
import com.yunyao.common.web.util.YResult;
import com.yunyao.framework.dto.posyupply.PoSosyupplySaveDto;
import com.yunyao.framework.dto.reconciliation.ReconciliationSaveDto;
import com.yunyao.framework.service.SupplierService;
import com.yunyao.framework.vo.reconciliation.ReconciliationinfoVO;
import com.yunyao.framework.vo.supplier.SupplierInfoVO;
import com.yunyao.framework.vo.supplier.SupplierSaveDto;
import com.yunyao.framework.vo.supplier.SupplierVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xingjishuai
 * @date 2024-07-17
 */
@RestController
@RequestMapping("/supplier")
public class SupplierController {
    @Autowired
    private SupplierService supplierService;

    @GetMapping("/list")
    public YResult<PageResult<SupplierVO>> getList(SupplierDto supplierDto) {
        return supplierService.getList(supplierDto);
    }

    @GetMapping("/info")
    public YResult<SupplierInfoVO> getInfo(SupplierDto supplierDto) {

        return supplierService.getByIdInfo(supplierDto);
    }

    @PostMapping("/delete")
    public YResult<Boolean> deleteInfo(@RequestBody SupplierDto supplierDto) {
        return supplierService.deleteInfo(supplierDto);
    }

    @PostMapping("/save")
    public YResult<String> saveInfo(@RequestBody SupplierSaveDto saveDto) {
        return supplierService.saveInfo(saveDto);
    }
}
